/*
 * Copyright the original author or authors.
 */
package com.derbysoft.core.reflect;

import javax.persistence.Entity;

/**
 * <code>JpaEntityClassFilter</code> only match class with JPA {@link Entity} annotation
 *
 * @author snowway
 * @since 2008-11-24
 */
public class JpaEntityClassFilter implements ClassFilter {

    @Override
    public boolean match(Class<?> clazz) {
        if (clazz == null) {
            throw new IllegalArgumentException("can not set null Class");
        }
        Entity entity = clazz.getAnnotation(Entity.class);
        return entity != null;
    }
}
